#ifndef TCPDIALOG_H
#define TCPDIALOG_H

#include <QDialog>

#include "tcpserver.h"

#include "threadpool.h"

namespace Ui {
class TCPDialog;
}

class TCPDialog : public QDialog
{
    Q_OBJECT

public:
    explicit TCPDialog(QWidget *parent = nullptr);
    ~TCPDialog();


private slots:
    void on_PB_send_clicked();

    void on_PB_sendBroadcast_clicked();

private:
    void initTcpServer();
    QString getLocalIpAddress();
private:
    Ui::TCPDialog *ui;

    TcpServer *m_server = nullptr;
    qintptr m_descriptorClient = -1;

    ThreadPool tp;
};

#endif // TCPDIALOG_H
